#ifndef __SS_FUNC_H__
#define __SS_FUNC_H__

namespace StarSeeker
{

template<typename FUNC, typename OBJ=void>
class ssFunc
{
public:
	ssFunc()
	{
		m_pObj = 0;
		m_pFunc = 0;
	}

	ssFunc(FUNC pFunc, OBJ* pObj=0)
	{
		Bind(pFunc, pObj);
	}

	inline void Bind(FUNC pFunc, OBJ* pObj = 0)
	{
		m_pObj = pObj;
		m_pFunc = pFunc;
	}

	inline bool IsClassFunc()
	{
		return m_pObj != 0;
	}


	OBJ* m_pObj;
	FUNC m_pFunc;
};
#define SS_FUNC(func_obj)		(func_obj.m_pFunc)
#define SS_CLASS_FUNC(func_obj)	(func_obj.m_pObj->*func_obj.m_pFunc)

}
#endif
